package com.lyx.server.controller;

import com.lyx.common.param.CouponAdd;
import com.lyx.common.param.CouponAudit;
import com.lyx.common.vo.R;
import com.lyx.server.service.CouponService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 优惠券表(Coupon)表控制层
 *
 * @author McMeloxD
 * @since 2024-08-14 17:40:22
 */
@RestController
@RequestMapping("/server/coupon")
public class CouponController  {
    /**
     * 服务对象
     */
    @Resource
    private CouponService couponService;

    /**
     * 服务对象
     */
    @Resource
    private CouponService service;

    @PostMapping("save")
    public R save(@RequestBody CouponAdd add){
        return service.save(add);
    }
    @PostMapping("audit")
    public R audit(@RequestBody CouponAudit audit){
        return service.audit(audit);
    }
    @GetMapping("all")
    public R all(String status){
        return service.queryWhere(status);
    }
}

